package com.base.vistter.iframe.converter;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
import org.apache.commons.collections4.map.HashedMap;

import java.util.Map;

public class AlarmStatusConverter implements Converter<Integer> {
    public static final Map<Integer, String> alarmStatus = new HashedMap<Integer, String>();

    static {
        alarmStatus.put(1, "进行中");
        alarmStatus.put(2, "已恢复");
    }

    @Override
    public WriteCellData<String> convertToExcelData(Integer value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
        return new WriteCellData<String>(alarmStatus.get(value));
    }
}
